package br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin.home.info;

import br.edu.ufcg.lsd.wbis.ui.client.beans.UserInfo;
import br.edu.ufcg.lsd.wbis.ui.client.ui.GenericWindow;
import br.edu.ufcg.lsd.wbis.ui.client.ui.ResetButtonListener;
import br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin.Updatable;
import br.edu.ufcg.lsd.wbis.ui.client.ui.management.InfoManager;

import com.gwtext.client.widgets.Button;

public class ChangePasswordWindow extends GenericWindow {

	public ChangePasswordWindow(Updatable<UserInfo> parentPortlet, InfoManager<UserInfo> infoManager) {
		this.setTitle("Change Password");
		this.setWidth(350);
		this.setHeight(175);
		this.setMinWidth(200);
		this.setMinHeight(150);

		final ChangePasswordPanel changePasswordPanel = new ChangePasswordPanel(infoManager);

		this.addButton(new Button("Update", new UpdatePasswordButtonListener(this, changePasswordPanel, parentPortlet, infoManager, infoManager)));
		this.addButton(new Button("Clear", new ResetButtonListener(changePasswordPanel)));
		this.add(changePasswordPanel);

		this.show();
	}
}
